import fetch from './index'

let  API={
    getLogin:{url:'./login'},
    getVerfyCode:{url:'./verifycode'},
    getNavData:{url:'./navData'}
}

if(window.model==='dev') {
    API={
        getLogin:{url:'./auth/login.action'},
        getVerfyCode:{url:'./auth/getValitionCode.action'},
        getNavData:{url:'./auth/developer/getUserInfo.action'},
        getGusseData:{url:'/developerUser/getList.action'},
        addUser:{url:'/developerUser/addUser.action'},
        deleteUser:{url:'/developerUser/deleteUser.action'},
        addDeveloperUserByFile:{url:'/developerUser/addDeveloperUserByFile.action'},
        getTransData:{url:'/trans/getTransList.action'},
        getSubsProductList:{url:'/product/getSubsProductList.action'},
        getProductList:{url:'/product/getProductList.action'},
        getProductDetail:{url:'/product/getProductDetail.action'},
        productSubscription:{url:'/product/productSubscription.action'},
        getProductData:{url:'/product/getSubsProductList.action'},
        productUnsubscription:{url:'/product/productUnsubscription.action'},
        getUserList:{url:'/developerUser/getUserList.action'},
        getDeveloperUserProductUseDetail:{url:'/product/getDeveloperUserProductUseDetail.action'},
        getMenuList:{url:'/menu/getMenuList.action'},
        getInterfacesByMenu:{url:'/menu/getInterfacesByMenu.action'},
        getDeveloperUserProductList:{url:'/product/getDeveloperUserProductList.action'},
        getAccessIntro:{url:'/api/accessIntro.action'},
        getSafetyIntro:{url:'/api/safetyIntro.action'},
        getInterfaceConfigList:{url:'/product/getInterfaceConfigList.action'},
        changePwd:{url:'/user/changePwd.action'},
        logout:{url:'/auth/logout.action'},
        getServiceList:{url:'/serviceTest/getServiceList.action'},
        callService:{url:'/serviceTest/callService.action'},
        updateCall:{url:'/interface/updateCallDesc.action'},
        getDetail:{url:'/interface/getDetail.action'}
    }
}

const loginApi = {
    getLogin(data={}){
        return fetch(Object.assign(API.getLogin,{data}))()
    },
    getVerfyCode(data={}){
       return fetch(Object.assign(API.getVerfyCode,{data}))()
    },
    getNavData(data={}){
        return fetch(Object.assign(API.getNavData,{data}))()
    },
    changePwd(data={}){
        return fetch(Object.assign(API.changePwd,{data}))()
    },
    logout(data={}){
    return fetch(Object.assign(API.logout,{data}))()
},
}

const transManage = {
    getGusseData(data={}){
        return fetch(Object.assign(API.getGusseData,{data}))()
    },
    addUser(data={}){
        return fetch(Object.assign(API.addUser,{data}))()
    },
    deleteUser(data={}){
        return fetch(Object.assign(API.deleteUser,{data}))()
    },
    addDeveloperUserByFile(data={}){
        return fetch(Object.assign(API.addDeveloperUserByFile,{data}))()
    },
    getUserList(data={}){
        return fetch(Object.assign(API.getUserList,{data}))()
    },
    getSubsProductList(data={}){
        return fetch(Object.assign(API.getSubsProductList,{data}))()
    },
    getDeveloperUserProductList(data={}){
        return fetch(Object.assign(API.getDeveloperUserProductList,{data}))()
    },
    getDeveloperUserProductUseDetail(data={}){
        return fetch(Object.assign(API.getDeveloperUserProductUseDetail,{data}))()
    }
}
const homePage = {
    getProductData(data={}){
        return fetch(Object.assign(API.getProductData,{data}))()
    }
   
}
const delevlop = {
    getMenuList(data={}){
        return fetch(Object.assign(API.getMenuList,{data}))()
    },
    getInterfacesByMenu(data={}){
        return fetch(Object.assign(API.getInterfacesByMenu,{data}))()
    },
    getAccessIntro(data={}){
        return fetch(Object.assign(API.getAccessIntro,{data}))()
    },
    getSafetyIntro(data={}){
        return fetch(Object.assign(API.getSafetyIntro,{data}))()
    },
    getServiceList(data={}){
        return fetch(Object.assign(API.getServiceList,{data}))()
    },
    callService(data={}){
        return fetch(Object.assign(API.callService,{data}))()
    },
    updateCall(data={}){
        return fetch(Object.assign(API.updateCall,{data}))()
    },
    getDetail(data={}){
        return fetch(Object.assign(API.getDetail,{data}))()
    }
}
const productSubs = {

    getProductDetail(data={}){
        return fetch(Object.assign(API.getProductDetail,{data}))()
    },
    productSubscription(data={}){
        return fetch(Object.assign(API.productSubscription,{data}))()
    },
    productUnsubscription(data={}){
        return fetch(Object.assign(API.productUnsubscription,{data}))()
    },
    getProductList(data={}){
        return fetch(Object.assign(API.getProductList,{data}))()
    },
    getInterfaceConfigList(data={}){
        return fetch(Object.assign(API.getInterfaceConfigList,{data}))()
    }


}


const logManage = {
    getTransData(data={}){
        return fetch(Object.assign(API.getTransData,{data}))()
    }

}



export  {loginApi,transManage,homePage,logManage,productSubs,delevlop}